
             
/**
 * Copyright (c) 2012-2013 JLLT Corp. 2012-2013,All Rights Reserved.
 * This software is published under the 金麟龙腾商贸有限公司.
 * License version 1.0, a copy of which has been included with this
 * distribution in the LICENSE.txt file.
 *
 * @File name:  TDeliveryAddressDao.java 
 * @Create on:  2012-10-09 11:34:629
 * @Author   :  陈伟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */
           
package com.boho.ecp.member.dao;

            
import java.sql.Connection;
import java.util.LinkedList;
import java.util.List;

import cn.boho.framework.po.CQuery;
import cn.boho.framework.po.CQueryFactoryTool;
import cn.boho.framework.po.DAO;
import cn.boho.framework.po.DynaBeanMap;
            
        /**
 * 【会员收货地址信息:T_DELIVERY_ADDRESS】的Dao操作类
 * 
 */
public class TDeliveryAddressDao extends DAO {
	/**
	* 查询所有【会员收货地址信息:T_DELIVERY_ADDRESS】信息
	* @param con
	* @return
	* @throws Exception
	* @date 2012-10-09
	* @author 陈伟
	*
	*/
	public static List queryTDeliveryAddress(Connection con, Integer memberId)throws Exception{
		List list = new LinkedList();
		StringBuffer sql = new StringBuffer();
		sql.append("select * from T_DELIVERY_ADDRESS where IS_VALID = 1 and MEMBER_ID = ? order by CREATE_DATE");
		CQuery query = CQueryFactoryTool.createFactory().createCQuery();
		query.setInt(1, memberId);
		query.setCommand(sql.toString());
		list = query.getDynaBeanMapList("T_DELIVERY_ADDRESS", con);
		return list;
	}
	
	/**
	* 分页查询所有【会员收货地址信息:T_DELIVERY_ADDRESS】信息
	* @param con
	* @param pager
	* @return
	* @throws Exception
	* @date 2012-10-09
	* @author 陈伟
	*
	*/
	public static DynaBeanMap getTDeliveryAddressByPk(Connection con,java.lang.Integer deliveryAddressId)throws Exception{
		DynaBeanMap dynaBeanMap = null;
		StringBuffer sql = new StringBuffer();
		sql.append("select * from T_DELIVERY_ADDRESS where DELIVERY_ADDRESS_ID = ? and IS_VALID = 1");
		CQuery query = CQueryFactoryTool.createFactory().createCQuery();
		query.setCommand(sql.toString());
		query.setInt(1,deliveryAddressId);
		dynaBeanMap = query.getDynaBeanMap("T_DELIVERY_ADDRESS", con);
		return dynaBeanMap;
	}
}
